import Vue from 'vue'
import Vuex from 'vuex'

Vue.use(Vuex)

export default new Vuex.Store({
  state: {
    tickCount: 0,
    runTime: 0,
    scene: '',
    gameData: {}
  },
  mutations: {
    incrementTickCount(state) {
      state.tickCount++
    },
    updateRunTime(state, tickTime) {
      state.runTime = Math.floor(tickTime / 100 * state.tickCount) / 10
    },
    updateScene(state, scene) {
      state.scene = scene
    },
    updateGameData(state, data) {
      state.gameData = data
    },
  },
  actions: {

  }
})
